<% layout('/layouts/default.html', {title: '我的卡券列表', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text('我的卡券列表')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${ztQuanself}" action="${ctx}/ztQuanself/listData" method="post" class="form-inline hide"

					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<#form:hidden path="ztAdmin.id"/>
				<div class="form-group">

					<label class="control-label">${text('券名')}：</label>

					<div class="control-inline">

						<#form:input path="ztQuan.name" maxlength="200" class="form-control width-120"/>

					</div>

				</div>
				
				<div class="form-group">

					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>

					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>

				</div>

			</#form:form>

			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>

// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [     
		
		{header:'${text('卡券券名')}', name:'ztQuan.name',index:'q.name',  width:150, align:"center"},
		
		{header:'${text('卡券类型')}', name:'ztQuan.type', index:'q.type', width:150, align:"center", formatter: function(val, obj, row, act){
			var str='优惠券';
			if(val==1){
				str='现金券';
			}
			return str;
		}},
		
		{header:'${text('卡券面值')}', name:'ztQuan.price', index:'q.price', width:150, align:"center"},
		
		{header:'${text('使用状态')}', name:'usestatus', index:'a.usestatus', width:100, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('zt_usestatus_type')}, val, '${text('有效')}', true);
		}},
		{header:'${text('获取时间')}', name:'createDate', index:'a.create_date', width:190, align:"center"},
		{header:'${text('到期时间')}', name:'ztQuan.toTime', index:'q.to_time', width:190, align:"center"}
		
		
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>